package com.cloud.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author: li wenda
 * @Description:
 * @Date Created in 2021-10-28 21:49
 * @Modified By:
 */
@RestController
@RequestMapping("user")
public class UserController {

    @GetMapping("info/{id}")
    public Map info(@PathVariable(name = "id") Long id) {
        Map<String, Object> user = new HashMap<>();
        user.put("id", id);
        user.put("name", "用户" + id);
        user.put("gender", id % 2 == 0 ? "男" : "女");
        return user;
    }
}
